#pragma once

namespace alt{
    template<typename T,typename U=T>
    class multiplicative{
    public:
        friend T operator/(const T& lhs,const U& rhs)
        {
            return T(lhs)/=rhs;
        }
        friend T operator*(const T& lhs,const U& rhs)
        {
            return T(lhs)*=rhs;
        }
        friend T operator*(const U& lhs,const T& rhs)
        {
            return T(rhs)*=lhs;
        }
    };
    template<typename T,typename U=T>
    class additive{
        friend T operator+(const T& lhs,const U& rhs)
        {
            return T(lhs)+=rhs;
        }
        friend T operator+(const U& lhs,const T& rhs)
        {
            return T(rhs)+=lhs;
        }

        friend T operator-(const T& lhs,const U& rhs)
        {
            return T(lhs)-=rhs;
        }
        friend T operator-(const U& lhs,const T& rhs)
        {
            return T(-rhs)+=lhs;
        }
    };
};
